{% load static %}
{% load i18n %}
<!DOCTYPE html>
<html lang="zh-cn" style="font-size: 14px;">
<head>
    <meta charset="UTF-8">
    <meta name=renderer  content=webkit>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
    <meta http-equiv="Cache-Control" content="no-transform" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta http-equiv="Cache-Control" content="max-age=7200" />
    <meta name="referrer" content="no-referrer">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="{% if site_keywords != None %}{{site_keywords}}{% endif %}"/>
    <meta name="description" content="{% if site_desc != None %}{{site_desc}}{% endif %}" />
    <title>{% block title %}{% trans "标签：" %}{{tag.name}}{% endblock %} - {% if site_name != None and site_name != '' %}{{ site_name }}{% else %}{% trans "站点标题" %}{% endif %}</title>

    <link href="{% static 'layui/css/layui.css' %}?version={{mrdoc_version}}" rel="stylesheet">
    {% if doc.editor_mode != 4 %}
        <link rel="stylesheet" href="{% static 'mr-marked/marked.css' %}?version={{mrdoc_version}}" />
    {% endif %}
    {% if doc.editor_mode == 2 %}
        <link rel="stylesheet" href="{% static 'vditor/dist/index.css' %}?version={{mrdoc_version}}" />
    {% endif %}
    {% if doc.editor_mode == 4 %}
        <!-- 在线表格 -->
        <link rel='stylesheet' href="{% static 'luckysheet/dist/plugins/css/pluginsCss.css' %}?version={{mrdoc_version}}" />
        <link rel='stylesheet' href="{% static 'luckysheet/dist/plugins/plugins.css' %}?version={{mrdoc_version}}" />
        <link rel='stylesheet' href="{% static 'luckysheet/dist/css/luckysheet.css' %}?version={{mrdoc_version}}" />
        <link rel='stylesheet' href="{% static 'luckysheet/dist/assets/iconfont/iconfont.css' %}?version={{mrdoc_version}}" />
    {% endif %}
    <link href="{% static 'viewerjs/viewer.min.css' %}?version={{mrdoc_version}}" rel="stylesheet">
    <link rel="icon" href="{% static 'search/mrdoc_logo_300.png' %}" sizes="192x192" />
    <link href="{% static 'mrdoc/mrdoc.css' %}?version={{mrdoc_version}}" rel="stylesheet">
    <link href="{% static 'mrdoc/mrdoc-docs.css' %}?version={{mrdoc_version}}" rel="stylesheet">
    <link href="{% static 'iconFont/iconfont.css' %}?version={{mrdoc_version}}" rel="stylesheet">
    <link href="{% static 'prismjs/prism.css' %}?version={{mrdoc_version}}" rel="stylesheet">
    <style>
        {% if img_scale %}
        .markdown-body p img{
            max-width: 350px;
        }
        {% endif %}
        {% if long_code == 'on' %}
        pre.linenums,pre.line-numbers,.vditor-reset > pre > code{
            max-height: max-content!important;
        }
        {% endif %}
        /* html{
        filter: invert(1) hue-rotate(180deg);
        } */
    </style>
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->

</head>
<body>
<div class="doc layui-fluid" style="padding-left:0px;">
    <!-- 左侧目录栏 -->
    <div class="doc-summary">
        <!-- 文档搜索 -->
        <form action="" method="get">
            <div id="doc-search-input">
                <input type="text" name="kw" placeholder="输入并回车搜索" value="" class="layui-input doc-search-input">
            </div>
        </form>
        <!-- 文集名称 -->
        <div class="project-title">
            <svg t="1726495807304" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10999" width="200" height="200"><path d="M510.467066 220.742515m-220.742515 0a220.742515 220.742515 0 1 0 441.48503 0 220.742515 220.742515 0 1 0-441.48503 0Z" fill="#4C91FF" p-id="11000"></path><path d="M421.556886 1014.802395L13.796407 607.041916c-12.263473-12.263473-12.263473-30.658683 0-42.922156L531.928144 45.988024c6.131737-6.131737 12.263473-9.197605 21.461078-9.197605L985.676647 12.263473c18.39521 0 33.724551 15.329341 33.724551 33.724551l-24.526947 432.287425c0 6.131737-3.065868 15.329341-9.197604 21.461078L464.479042 1014.802395c-12.263473 12.263473-30.658683 12.263473-42.922156 0zM99.640719 607.041916l321.916167 321.916168c12.263473 12.263473 30.658683 12.263473 42.922156 0l459.880239-459.88024c6.131737-6.131737 9.197605-12.263473 9.197605-21.461078L955.017964 73.580838l-377.101796 21.461078c-6.131737 0-15.329341 3.065868-21.461078 9.197605l-459.88024 459.880239c-9.197605 12.263473-9.197605 30.658683 3.065869 42.922156z" fill="#231815" p-id="11001"></path><path d="M761.868263 285.125749m-64.383233 0a64.383234 64.383234 0 1 0 128.766467 0 64.383234 64.383234 0 1 0-128.766467 0Z" fill="#231815" p-id="11002"></path></svg> 
            {% trans "标签：" %}<a href="{% url 'tag_docs' tag.id %}">{{ tag.name }}
                {% if project.role == 1 %}
                    <i class="layui-icon layui-icon-password" title="私密文档"></i>
                {% endif %}
            </a>
        </div>
        <hr>
        
        <!-- 遍历文集大纲 -->
        {% load doc_filter %}
        <nav>
            <ul class="summary">
            <!-- 一级目录 -->
            {% for doc in docs %}
                <li tooltip="{{doc.doc.top_doc | get_doc_top}}" placement="bottom">
                    <a href="{% url 'tag_doc' tag_id=tag.id doc_id=doc.doc.id %}" target="_blank" ><i class="{% if doc.doc.editor_mode == 4 %}layui-icon layui-icon-table {% else %}iconfont mrdoc-icon-wendang{% endif %}"></i> {{ doc.doc.name }}</a>
                </li>
            {% endfor %}
            </ul>
        </nav>
        <div class="bq">
            <a href="javascript:void(0);" class="mrdoc-link" id="dashang">{% trans "本文档使用 MrDoc 发布" %}</a>
        </div>
        <!-- 右下角广告块 -->
        <!-- 广告代码开始 -->
        {% if debug %}
        {% else %}
            {% if ad_code_3 %}
                <div class="ad-code">
                {{ ad_code_3 | safe }}
                </div>
            {% endif %}
        {% endif %}
        <!-- 广告代码结束 -->
    </div>
    <!-- 左侧目录栏结束 -->

    <!-- 右侧文档栏 -->
    <div class="doc-body">
        <!-- 文档导航 -->
        <div class="doc-header" role="navigation">
            <a class="btn pull-left js-toolbar-action" aria-label="" href="javascript:void(0);" title="切换侧边栏">
                <i class="layui-icon layui-icon-slider"></i>
            </a>
            <a class="btn pull-left font-small"  href="javascript:void(0);" title="缩小字体">
                <i class="iconfont mrdoc-icon-font-size">-</i>
            </a>
            <a class="btn pull-left font-large"  href="javascript:void(0);" title="放大字体">
                <i class="iconfont mrdoc-icon-font-size">+</i>
            </a>
            <a class="btn pull-left font-switch" href="javascript:void(0);" title="切换字体类型">
                <i class="iconfont mrdoc-icon-font-type"></i>
            </a>
            <a class="btn pull-left theme-switch" href="javascript:void(0);" title="{% trans '切换至夜间模式' %}">
                <i class="iconfont mrdoc-icon-night"></i>
            </a>
            <!-- 顶部工具栏 -->
            {% block head_toolbar %}
            {% endblock %}

            <a class="btn pull-right" aria-label="" href="{% url 'pro_list' %}">
                <i class="layui-icon layui-icon-home"></i> <span class="layui-hide-xs">{% trans "首页" %}</span>
            </a>
        </div>
        <!-- 文档主体 -->
        <div class="doc-body-content">
            <div class="doc-body-content-div">
                <!-- 文档内容 -->
                <div class="doc-content">
                    <!-- 标题 -->
                    <div class="doc-info">
                        <!-- 页面主体头信息 -->
                        {% block content_head %}
                        <h1>{% trans "标签：" %}{{ tag.name }}</h1><hr>
                        {% endblock %}

                        <!-- 广告代码开始 -->
                        {% if debug %}
                        {% else %}
                            {% if ad_code %}
                                <div class="ad-code">
                                {{ ad_code | safe }}
                                </div>
                            {% endif %}
                        {% endif %}
                        <!-- 广告代码结束 -->
                    </div>
                    <!-- 标题结束 -->
                    <!-- 正文开始 -->
                    <div class="markdown-body" id="content">
                        {% block page_content %}
                        <div id="tag-relation-chart" style="max-width: max-content;width: 800px;height: 600px;">
                        </div>
                        {% endblock %}
                    </div>
                    <!-- 正文结束 -->
                    <hr>
                </div>
                <!-- 分享栏 -->
                <div style="color: rgba(0,0,0,.65);margin-bottom: 10px;margin-top: 10px;">
                {% block doc_bottom_block %}
                {% endblock %}
                </div>

                <!-- 广告代码开始 -->
                {% if debug %}
                {% else %}
                    {% if ad_code_2 %}
                        <div class="ad-code">
                        {{ ad_code_2 | safe }}
                        </div>
                    {% endif %}
                {% endif %}
                <!-- 广告代码结束 -->

                {% block doc_previous_next %}{% endblock %}
            </div>
        </div>
    </div>
    <!-- 右侧文档栏结束 -->
    <div class="fixed-tool-bar">
        <div class="toTop" ><i class="layui-icon layui-icon-up"></i></div>
        {% block right_widget %} {% endblock %}
    </div>
</div>

<!-- 转发选项卡模板 -->
<div id="share_div" style="display: none;">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">手机扫码</li>
            <li>复制链接</li>
        </ul>
    <div class="layui-tab-content" style="height: 100px;">
        <div class="layui-tab-item layui-show" align='center'>
            <p style="font-weight: 700;margin-bottom: 10px;">手机扫一扫转发分享</p>
            <div id="url_qrcode"></div>
        </div>
        <div class="layui-tab-item" align='center'>
            <input type="text" id="copy_crt_url" name="current_url" class="layui-input" /><br>
            <button class="layui-btn layui-btn-radius layui-btn-xs" style="background-color: #333;" onclick="copyUrl();">复制链接</button>
        </div>
    </div>
    </div> 
</div>

<script src="{% static 'jquery/3.5.0/jquery.min.js' %}"></script>
<script src="{% static 'layui/layui.js' %}?version={{mrdoc_version}}"></script>
<script src="{% static 'viewerjs/viewer.min.js' %}?version={{mrdoc_version}}"></script>
<script src="{% static 'qrcodejs/qrcode.min.js' %}?version={{mrdoc_version}}"></script>
<script src="{% static 'darkmode-js/darkmode-js.min.js' %}?version={{mrdoc_version}}"></script>
<script src="{% static 'mrdoc/mrdoc-docs.js' %}?version={{mrdoc_version}}"></script>
<script src="{% static 'iconFont/iconfont.js' %}?version={{mrdoc_version}}"></script>
<script src="{% static 'mr-marked/echarts/echarts.min.js' %}?version={{mrdoc_version}}"></script>
<!-- 生成文集目录大纲 -->
<script>
    $.ajaxSetup({
        data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
    });

    //为当前页面的目录链接添加蓝色样式
    tagCurrentDoc = function(){
        $("nav li a").each(function (i) {
            var $me = $(this);
            var lochref = $.trim(window.location.href); // 获取当前URL
            var mehref = $.trim($me.get(0).href); 
            if (lochref.indexOf(mehref) != -1) {
                // console.log($me,lochref,mehref)
                $me.closest("li").addClass("active");
                //展开当前文档的上级目录
                $me.parent("li").parent('ul.sub-menu').toggleClass("toc-close toc-open"); //展开二级目录
                $me.parent("div").parent('li').parent('ul.sub-menu').toggleClass("toc-close toc-open"); //展开还有子级的二级目录
                $me.parent("li").parent('ul').parent('li').parent('ul.sub-menu').toggleClass("toc-close toc-open"); //展开三级目录
                $me.parents("ul.sub-menu").prevAll("div").children("i").toggleClass("fa-chevron-left fa-chevron-down");//切换图标
            } else {
                // console.log(lochref,mehref)
                $me.closest("li").removeClass("active");
            }
        });
    };
</script>

{% if doc.editor_mode == 2 %}
<script src="{% static 'vditor/dist/method.min.js' %}?version={{mrdoc_version}}"></script>
{% elif doc.editor_mode == 1 %}
<script src="{% static 'mr-marked/marked.min.js' %}?version={{mrdoc_version}}"></script>
{% elif doc.editor_mode == 4 %}
<!-- 在线表格 -->
<script src="{% static 'luckysheet/dist/plugins/js/plugin.js' %}?version={{mrdoc_version}}"></script>
<script src="{% static 'luckysheet/dist/luckysheet.umd.js' %}?version={{mrdoc_version}}"></script>
{% endif %}

<script>
    // 外部链接添加图标
    document.addEventListener('DOMContentLoaded', function() {
        Array.prototype.filter.call(document.links, function(link) {
            return link.hostname && link.hostname !== location.hostname;
        })
        .forEach(function(link) {
            // console.log(link,$(link).children('img').length)
            if($(link).children().length == 0){
                link.classList.add('external');
            }
        });
    });

</script>

<!-- 动态添加广告代码 -->
{% if debug %}
{% else %}
<div id="ad-1">
    {{ad_code|safe}}
</div>
<div id="ad-2">
    {{ad_code_2|safe}}
</div>
<div id="ad-3">
    {{ad_code_3|safe}}
</div>
<script>
    $("#ad-1").appendTo($("#ad-code-1"));
    $("#ad-2").appendTo($("#ad-code-2"));
    $("#ad-3").appendTo($("#ad-code-3"));
</script>
{% endif %}
<!-- 广告代码结束 -->

<!-- 统计代码开始 -->
    {% if debug %}
    {% else %}
        {{ static_code | safe }}
    {% endif %}
<!-- 统计代码结束 -->
{% block custom_script %}
{% endblock %}
</body>
</html>